package com.example.androidautoproject.service

import android.util.Log
import com.example.androidautoproject.utils.AutoScript
import com.example.androidautoproject.utils.AdParam
import com.ven.assists.stepper.Step
import com.ven.assists.stepper.StepCollector
import com.ven.assists.stepper.StepImpl

class SlideAuto: StepImpl() {
    private val TAG = "fengyiFreeProject"
    override fun onImpl(collector: StepCollector) {
        collector.next(stepTag = 1){
            var i = 0
            AdParam.isStart = true
            while (true){
                if(AdParam.isStart){
                    Thread.sleep(15000 + AutoScript.ran_time)
                    i++
                    AutoScript.vertical_swipe()
                    Log.d(TAG, "开始滑动${i}次")
                }else{
                    break
                }
            }
            return@next Step.get(2)
        }.next(stepTag = 2){
            //执行第3步
            return@next Step.get(3)
        }.next(stepTag = 3){
            //结束执行
            Log.d(TAG, "开始结束滑动")
            return@next Step.none
        }
    }
}